package com.liachen.stock.mapstruct;

import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import com.liachen.stock.entity.StockInfo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;

/**
 * @author EDY
 */
//@Mapper
public interface StockMapStruct {
    @Mapping(source = "股票代码", target = "code")
    @Mapping(source = "市销率(ps)[20240607]", target = "ps")
    @Mapping(source = "市净率(pb)[20240607]", target = "pb")
    @Mapping(source = "a股市值(不含限售股)[20240607]", target = "marketAmount")
    @Mapping(source = "新股上市日期", target = "startDate")
    @Mapping(source = "市盈率(pe)[20240607]", target = "pe")
    @Mapping(source = "股票简称", target = "name")
    @Mapping(source = "历史peg值[20240607]", target = "historyPeg")
    List<StockInfo> convertFrom(JSONArray source);
}
